<link rel="stylesheet" type="text/css" href="../addons/jy_chengedu/css/common.css?v=2016063000">
<style>
    .fui-list-group{
        margin-top: 0;
    }
.fe-floatright-bottom a {
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 100%;
    background-color: #ff9999;
    color: #fff;
    line-height: 0.7rem;
	font-size:0.45rem;
    margin: 0.5rem auto;
    margin-right: 0;
}
.fe-floatright-bottom a .icon {
    color: #fff;
    font-size: 0.6rem;
    height: 0.6rem;
	line-height: 1rem;
    opacity: 1;
}

</style>
<div class="fui-page page-school-list">
    <div class="fui-content" style="bottom: 2.4rem">
       
        <div id="carousel-container" ng-if="pagedata.pluginset.hdps.length>0" class="carousel slide" data-role="carousel" data-param-auto="true">
			<div class="carousel-inner" role="listbox" style="height:6rem">
				<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.pluginset.hdps">
					<a href="#">
						<img src="{{tomedia(item.picurl) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
			</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
			</style>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
				<div class="fui-swipe-bullet" ng-repeat="item in pagedata.pluginset.hdps" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>


        <div ng-repeat="value in pagedata.list" class="fui-list store-item">
					<div class="fui-list-media">
						<div class="fui-list-media">
							<a ng-click="access_json('/school//id='+value.id)">
								<img src="{{tomedia(value.logo) || '../core/resource/images/nopic.jpg'}}" class="round">
							</a>
						 </div>
					</div>
					<div class="fui-list-inner store-inner">
						<a ng-click="access_json('/school//id='+value.id)">
						<div class="title"> <span class='storename'>{{value.title}}</span></div>
						<div ng-if="value.address!=''" class="text">
							地址: <span class='realname'>{{value.address}}</span>
						</div>
						<div  ng-if="value.mobile!=''" class="text">
							电话: <span class='address'>{{value.mobile}}</span>
						</div>
						<div ng-if="value.catename!=''" class="text">
							分类: <span class='address'>{{value.catename}}</span>
						</div>
					  <div class="text location" style="color:green;">
							距离您:{{value.juli}}km
						</div>
						</a>
					</div>
					<div class="fui-list-angle ">
					  <a href="tel:{{value.mobile}}" class='external'><i class=' icon icon-phone' style='color:green'></i></a>
					  <a ng-click="pagedata.openLocation(value)" class='external'><i class='icon icon-map' style='color:#f90'></i></a>
					</div>
				</div>
    </div>

</div>
<div class="fe-floatright-bottom right" style="bottom:60px;">
			<a href="javascript:;" style="background-color: #ff6666;" ng-click="toogle(pagedata,'show_shopset',[1,0])">
				<i ng-class="{'icon':1,'icon-less':pagedata.show_shopset !=1,'icon-moreunfold':pagedata.show_shopset ==1}" style="font-size:0.8rem;"></i>
				<div style="line-height:0.3rem">{{pagedata.show_shopset !=1?'我的':'关闭'}}</div>
			</a>
</div>
<div ng-if="pagedata.show_shopset" class="fe-floatright-bottom right" style="bottom:6.6rem;">
		<a href="javascript:" ng-click="access_json('jy_chengedu/school//id='+pagedata.store.id)">
				<i class="icon icon-shouye"></i>
				<div style="line-height:0.3rem">店铺</div>
		</a>
		<a href="javascript:" ng-click="access_json('jy_chengedu/manage.shop//id='+pagedata.store.id)" class="nav-item">
			<i class="icon icon-set"></i>
			<div style="line-height:0.3rem">设置</div>
		</a>
		<a href="javascript:" ng-click="access_json('jy_chengedu/manage.index/')" class="nav-item">
			<i class="icon icon-wo1"></i>
			<div style="line-height:0.3rem">我的</div>
		</a>
</div>
<script type="text/javascript">

var lat_lng ={}
	scope.scroll(function(){
		scope.$apply();
		setTimeout('scope.pagedata.getlist()',2000);
	},false,'svposttext');
// 百度地图API功能
window.scope.location(function(re){
		//console.log(re);
		lat_lng = re.lat_lng;
		scope.pagedata.getlist(re.lat_lng);
});
scope.loading = true;
var page = 1;
var keyword = '';
scope.pagedata.getlist=function(e){
	if(e==1){
		page = 1;
		scope.pagedata.list=[]
	}
	if(scope.pagedata.params.keyword!=null){
		 keyword =scope.pagedata.params.keyword;
	}else{
		keyword ='';
	}
	
		var params = {
					'plugin':'jy_chengedu',
					'action':'list',
					'op':'list',
					'data':{
						'page':page,
						'lat_lng':lat_lng,
						'key':e,
						'keyword':keyword,
					},
					'callback':function(data){
							if(data.error !=1){
							 for (var i=0;i<data.list.length;i++){
									scope.pagedata.list.push(data.list[i]);
								}
								if(page >1){
									$("#store-item").animate({scrollTop:0},300);
								}
								page++;
								scope.loading = false;
								window.scope.pagedata.list=data.list;
								scope.$apply();
							}else{
								onsole.log('error');
							};
					}
		}
		scope.post_json(params);
}
scope.pagedata.getlist(1);

</script>